Skip to content

feat(file_system): Return early from remove() if path does not exist#507

Merged
finger563 merged 1 commit intomainfrom
feat/fs-remove-non-existent-return-early
Aug 21, 2025
Merged

feat(file_system): Return early from remove() if path does not exist#507
finger563 merged 1 commit intomainfrom
feat/fs-remove-non-existent-return-early

Conversation

@finger563
Copy link
Copy Markdown
Contributor

@finger563 finger563 commented Aug 21, 2025

Description

  • Return early from espp::FileSystem::remove(path, error_code) if the path does not exist (error_code is set by std::filesystem::status).
  • Add check to example for ensuring fale/error_code are properlyset when trying to remove a non-existent file.

Motivation and Context

  • Adds a missing check for completeness to espp::FileSystem::remove(path, error_code).
  • Ensures the code doesn't attempt to remove a file that doesn't exist, which could lead to unnecessary error handling.

How has this been tested?

  • Build and run file_system/example on qtpy esp32s3

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

CleanShot 2025-08-21 at 10 11 39

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • [] I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

@github-actions
Copy link
Copy Markdown

✅Static analysis result - no issues found! ✅

@finger563 finger563 self-assigned this Aug 21, 2025
@finger563 finger563 added enhancement New feature or request file system labels Aug 21, 2025
@finger563 finger563 merged commit 19603fb into main Aug 21, 2025
90 of 93 checks passed
@finger563 finger563 deleted the feat/fs-remove-non-existent-return-early branch August 21, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request file system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant